package com.ibeeking.found.content.api.feign;

import com.ibeeking.found.content.api.common.dto.MemberInfoDTO;

import com.ibeeking.found.content.api.feign.fallback.ContentMemberBFallbackFactory;
import com.ibeeking.nematos.utils.result.ResponseResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;
import java.util.Set;

/**
 * @Author ibeeking
 */
@FeignClient(name = "mall-member-b-server", path = "/b", contextId = "contentMemberBClient", fallbackFactory = ContentMemberBFallbackFactory.class, decode404 = true)
public interface ContentMemberBClient {

    /**
     * 通过会员id查询会员信息
     *
     * @param ids
     * @return
     */
    @PostMapping(value = "/member/feign/v1/info")
    ResponseResult<List<MemberInfoDTO>> infoList(@RequestBody Set<Long> ids);

    /**
     * 查询全部会员id
     *
     * @return
     */
    @PostMapping(value = "/member/feign/v1/allMemberId")
    ResponseResult<List<Long>> allMemberId();

    /**
     * 根据手机号查询会员id
     *
     * @param phone
     * @return
     */
    @PostMapping(value = "/member/feign/v1/queryMemberIdsByPhoneLike/{phone}")
    ResponseResult<List<Long>> queryMemberIdsByPhoneLike(@PathVariable("phone") String phone);
}
